// 自己尝试封装一个表示日期时间的类

class DateTime {
    #year;
    #month;
    #date;
    #hours;
    #minutes;
    #seconds;
    #milliseconds;
    constructor(y,mon,d,h,min,s,ms){
        this.#year = y ;
        this.#month = mon ;
        this.#date = d ;
        this.#hours = h;
        this.#minutes = min ;
        this.#seconds = s ;
        this.#milliseconds = ms ;
    }
    set year(y){
        this.#year = y ;
    }
    get year(){
        return this.#year ;
    }
    toString(){
        return this.#year + '年' + this.#month + '月' + this.#date + '日' ;
    }
}

let birthdate = new DateTime( 1999 , 10 , 10 , 8 , 30 , 50 , 500 );
console.log( birthdate.toString() );